<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        var reg=/o/

        var str='hello world'
        console.log(reg.test(str));//true

        var result=str.match(reg)
        console.log(result);

        var s=str.replace(reg,"@");
        console.log(s);

    </script>
</head>
<body>

    
</body>
</html>